package test04.method.demo01;

/**
 * @author ZQX
 * @date 2025-04-02
 */
public class User {
    /**
     * 函数式接口作为方法参数的使用
     *
     * @param name
     * @param iWenHou
     */
    public void wenHao(String name, IWenHou iWenHou) {
        iWenHou.sayHello(name);
    }

    public void goodMorning(String name) {
        System.out.println("早上好，" + name);
    }

    public static void goodAfternoon(String name) {
        System.out.println("下午好，" + name);
    }

    /**
     * 问候 - 晚上好 - 静态方法 - 注意：此方法与函数式接口的方法不匹配
     *
     * @return
     */
    public static int goodNight() {
        System.out.println("晚安");
        return 8;
    }

    public static int goodNight01(String name) {
        System.out.println("晚安，" + name);
        return 8;
    }
}
